import React,{Commpoent} from 'react';
import NavItem from './NavItem';
import {NAV} from '../../../config/config'
import './index.scss';
export default class SideBar extends Commpoent{
    constructor(props){
        super(this.props)
    }
    render(){
        const {curIdx,onNavItemClick} = this.props
        return(
            <aside className="side-bar">
                {
                    NAV.map((item,index)=>{
                        return (
                            <NavItem
                                dataItem={item}
                                index={index}
                                key={index}
                                curIdx={curIdx}
                                onNavItemClick={onNavItemClick}
                            ></NavItem>
                        )
                    })
                }
            </aside>
        )
    }
}